use std::thread;
use std::time::Duration;
use console::{style, Style, Term};

fn main() -> Result<(), Box<dyn std::error::Error>> {

    //输出内容到控制台
    let term = Term::stdout();
    term.write_line("Hello World!")?;
    thread::sleep(Duration::from_millis(1000));
    term.clear_line()?;

    //选定字体颜色输出
    println!("This is {} neat", style("quite").cyan());

    //您还可以存储样式并稍后将它们应用到文本：
    let cyan = Style::new().green();
    println!("This is {} neat", cyan.apply_to("quite"));

    Ok(())
}
